<?php

echo anchor('forum/newtopic/'.$category_id, lang('Start new topic'));

if ($topics){
  echo '<table class="fw fb">';
  echo '<thead>';
  echo '<tr>';
  echo '<th class="ico">'.'ico'.'</th>';
  echo '<th class="topic">'.lang('Topic').'</th>';
  echo '<th class="replies">'.lang('Replies').'</th>';
  echo '<th class="views">'.lang('Views').'</th>';
  echo '<th class="date">'.lang('Date').'</th>';
  echo '</tr>';
  echo '</thead>';
  echo '<tbody>';
  foreach($topics as $row){
    echo '<tr>';
    echo '<td>[ICO]</td>';
    echo '<td>'.anchor('topic/'.$row['post_id'].'/'.$row['post_slug'], $row['title']);
    echo '  <p>'.lang('By').': '.anchor('user/profile/'.$row['user_id'], $row['username']).'</p>';
    echo '</td>';
    echo '<td>'.$row['replies'].'</td>';
    echo '<td>'.$row['views'].'</td>';
    echo '<td>';
    echo date('d.m.Y H:i', $row['created']);
    if ($row['last_user_id']){
      echo '<br/>'.lang('By').': '.anchor('user/profile/'.$row['last_user_id'], $row['last_username']);
    }
    echo '</td>';
    echo '</tr>';
  }
  echo '</tbody>';
  echo '</table>';
  echo $this->pagination->create_links();
} else {
  echo '<p class="notice">'.lang('This category is empty').'</p>';
}
?>
